package com.qiang.test02;

import java.net.InetAddress;
import java.net.UnknownHostException;

public class Demo01 {
    public static void main(String[] args) throws UnknownHostException {
        InetAddress byName = InetAddress.getByName("192.168.12.23");
        String hostAddress = byName.getHostAddress();
        String hostName = byName.getHostName();
        System.out.println(hostAddress);
        System.out.println(hostName);
    }
}
